﻿@{
    Layout = null;

}

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>keepPwd</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta name="viewport" content=" initial-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <script>
        function startWebsocket() {
            var ws = new WebSocket("ws://localhost:50939/ws");
            ws.onopen = function (evt) {
                console.log("Connection open ...");
                isOpenWebSocket = true;
                ws.send(JSON.stringify({
                    DBName: "testDB",
                    Code: "123"
                }));
            };
            ws.onmessage = function (evt) {
                isOpenWebSocket = true;
                console.log("Received Message: " + evt.data);
            };
            ws.onclose = function (evt) {
                isOpenWebSocket = false;
                console.log("Connection closed.");
            };
            ws.onerror = function (evt) {
                console.log("Error: " + evt.data);
            };
            window.onunload = function () {
                ws.close();
                isOpenWebSocket = false;
            }
        } 
        startWebsocket();
    </script>
</head>

<body>
</body>
</html>